import { Sequelize } from 'sequelize';

export const sequelize = new Sequelize(
    {
        dialect:'sqlite',
        storage:'./db.db'
    }
);

export const sync = async () => {
    let { Blog } =await import('../model/Blog.js')
    await sequelize.sync({force:true})
    let arr = [
        {
            title:'07年快乐男声总冠军',
            author:'陈楚生'
        },
        {
            title:'07年快乐男声西安冠军',
            author:"苏醒"
        },
        {
            title:'07年快乐男声广州冠军',
            author:'王栎鑫'
        },
        {
            title:'07年快乐男声南京冠军',
            author:'张远'
        },
        {
            title:'95年世界青年组手风琴冠军',
            author:'王铮亮'
        },
        {
            title:'07年快乐男声长沙冠军',
            author:'陆虎'
        },
        {
            title:'一站到底战神之神',
            author:'蒲熠星'
        }
    ]
    Blog.bulkCreate(arr)
}